home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Risc World 3
/
Risc World 3.iso
/
SOFTWARE
/
ISSUE2
/
PD
/
CAMPINS.ZIP
/
resources
/
camchk
(
.txt
)
next >
Wrap
RISC OS BBC BASIC V Source
|
2002-06-06
|
5KB
|
211 lines
ON ERROR PRINT ERR,"Line:";ERL,REPORT$:END
V1.40
buffer2% 512
"OS_GetEnv"
buffer2%
!command$=
getstring(buffer2%)
3path$=
command$,
(command$)-
command$,""" ")-1)
path$,1)=
path$=
path$,2)
path$,1)=
path$=
path$,
path$-1)
rzstring$=
canonpath(path$)
rzstring$="ADFS::HardDisc4.$.cURL.CamPins.resources.image"
forces the Image to be closed just in case its been left open.
opencheck(rzstring$) <>0
"OS_Find",&00,rzfilehandle%
check to see if Image file exists
"OS_File",5,rzstring$
rzfound%
rzfound%=0
("set campinf 0")
("set campinf 1")
("Set ChangeFSI$Y 0")
("Set ChangeFSI$X 0")
rzfound%>0
Checks to see if CURL download size checks with actual size of Image file.
"OS_GSTrans","<curl_size_download>",buffer2%,512
% rzsize%=
getstring(buffer2%)
"OS_File",5,rzstring$
,,,,rzsizeactual%
rzsize% <> rzsizeactual%
rzfound%=0
rzfound%>0
#&
Read what type of file it is.
$*
"OS_Find",&C0,rzstring$
handle%
ident$=
#handle%
#handle%
Check to see if JPEG is a nonstandard 'AXIS' type.
If it is. Clean it up.
rzflag%=
:htmlflag%=
->
rzflag%=
ident$,"AXIS")
rzflag%=
("Cleanup")
.]
rzflag%=
ident$,"HTML")
ident$,"head"))
rzflag%=
:htmlflag%=
notfound:
/P
rzflag%=
ident$,"JFIF")
rzflag%=
("settype "+rzstring$+" C85")
0P
rzflag%=
ident$,"GIF")
rzflag%=
("settype "+rzstring$+" 695")
1;
rzflag%=
ident$,"MM")
ident$,"II*") )
rzflag%=
3(
("settype "+rzstring$+" FF0")
"<campin$dir>.CFSI"
6[ A$="<campin$dir>.CFSI <campin$dir>.image <campin$dir>.sprite 1 -nodither -nomode"
foo%=1
80 A%=
ChangeFSI(A$,-1,-1,0,-1,-1,foo%,
95
("Seteval ImageSize$Height <ChangeFSI$Y>")
:7
("Seteval ImageSize$Width <ChangeFSI$X>")
<3
("<campin$dir>.imagesize -n "+rzstring$)
?8
"OS_GSTrans","<ImageSize$Height>",buffer2%,512
@% height%=
getstring(buffer2%)
A7
"OS_GSTrans","<ImageSize$Width>",buffer2%,512
B$ width%=
getstring(buffer2%)
modeinfo
colours$="28r "
("Set col "+colours$)
scale$="1:1"
H-
colours% > 3
colours$="S16,90,90 "
PRINT "Got in..."
iconbarheight%=0:
width%>height%
N! width%+=iconbarheight%
O( calx%=(xaxisa%/width%)*width%
P) caly%=(xaxisa%/width%)*height%
Q( scale$=
xaxisa%+":"+
width%
iconbarheight%=88
T! height%+=iconbarheight%
U( calx%=(yaxisa%/height%)*width%
V) caly%=(yaxisa%/height%)*height%
W( scale$=
yaxisa%+":"+
height%
ZO
if image is almost the width of the screen mode, but much taller, then
[G
scale it to its height instead. This helps it fit onto screen.
]2
(xaxisa%-width%) <99
height%>yaxisa%
^) scale$=
yaxisa%+":"+
height%
bK
if image is small (about half size of screen) then tile it instead
c>
(width% <= (xaxisa% /2))
(height% < (yaxisa% /2))
backdrop$="-T"
scale$="140:100"
backdrop$="-C"
("Set col "+colours$)
("Set bkd "+backdrop$)
("Set scale "+scale$)
notfound
PRINT "Passed..."
notfound
("Set col 28r")
("Set bkd -T")
("Set scale 1:1")
yG
forces the Image to be closed just in case its been left open.
z"
"XOS_Find",&00,rzstring$
{5
("Copy campin:Image campin:duffImage ~CFS~V")
|(
("setType campin:duffImage 000")
}2
("Copy campin:failed campin:Image ~CFS~V")
~3
("Copy campin:failed campin:Sprite ~CFS~V")
htmlflag%=
,
("settype campin:duffImage HTML")
modeinfo
"OS_ReadModeVariable",-1,11
,,xaxisa%
"OS_ReadModeVariable",-1,12
,,yaxisa%
"OS_ReadModeVariable",-1,4
,,xscale%
"OS_ReadModeVariable",-1,5
,,yscale%
"OS_ReadModeVariable",-1,9
,,colours%
! xaxis%=(xaxisa%*(2^xscale%))
! yaxis%=(yaxisa%*(2^yscale%))
xaxisa%+=1:yaxisa%+=1
canonpath(path$)
"OS_FSControl",37,path$,buffer2%,0,0,512
getstring(buffer2%)
getstring(ptr%)
p$=""
(?ptr%>31
?ptr%<256)
(p$)<255
c%=?ptr%
IF c%>=97 AND c%<=122 THEN c%-=32
p$+=
ptr%+=1
opencheck(rzstring$)
A%,B%,A$
rzfilehandle%=0
A%=255
2
"XOS_Args",7,A%,buffer2%,,,512
,,,,,B%
A$=
getstring(buffer2%)
:
B% < 512
rzstring$=A$
rzfilehandle%=A%:A%=1
=rzfilehandle%